package com.shiva.oms.logview.domain;

import java.text.DateFormat;
import java.util.HashMap;

public class ParsingContext {

    private StringBuilder unmatchedLog;
    private long lastParsed = 0;
    private int generatedId = 0;
    // private String name;
    // private String logSource;
    private HashMap<String, Object> customConextProperties;
    private DateFormat dateFormat;

    public ParsingContext() {
        this("?");
    }

    public ParsingContext(String name) {
        this(name, null);
    }

    public ParsingContext(String name, String logSource) {
        // this.name = name;
        // this.logSource = logSource;
        unmatchedLog = new StringBuilder();
        customConextProperties = new HashMap<>();
    }

    public HashMap<String, Object> getCustomConextProperties() {
        return customConextProperties;
    }

    public void setCustomConextProperties(HashMap<String, Object> customConextProperties) {
        this.customConextProperties = customConextProperties;
    }

    public int getGeneratedId() {
        return generatedId;
    }

    public int getGeneratedIdAndIncrease() {
        return generatedId++;
    }

    public void setGeneratedId(int generatedId) {
        this.generatedId = generatedId;
    }

    public long getLastParsed() {
        return lastParsed;
    }

    public void setLastParsed(long lastParsed) {
        this.lastParsed = lastParsed;
    }

    public StringBuilder getUnmatchedLog() {
        return unmatchedLog;
    }

    public void setUnmatchedLog(StringBuilder unmatchedLog) {
        this.unmatchedLog = unmatchedLog;
    }

    public DateFormat getDateFormat() {
        return dateFormat;
    }

    public void setDateFormat(DateFormat dateFormat) {
        this.dateFormat = dateFormat;
    }

}
